home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 020a / rmastr02.zip / DEMO6.PAS < prev    next >
Pascal/Delphi Source File  |  1991-09-25  |  1KB  |  53 lines

  1. (* Saving a file from Raster Master as a BGF file and using the BINOBJ
  2.    program to convert it to an object file allows you to include
  3.    the image as a part of your executable.
  4.  
  5.    eg.
  6.  
  7.    DOS>BINOBJ DISK.BGF DISK.OBJ DISK
  8.  
  9.  
  10.    Using the above format we create a procedure name DISK and
  11.    link the object file.
  12.  
  13.    Procedure Disk; External;
  14.    {$L DISK.OBJ}
  15.  
  16.  
  17.    Because the PutImage procedure requires that the Image be in a pointer,
  18.    we transfer the address of the procedure to a pointer. To display the
  19.    Image use the PutImage procedure.
  20.  
  21.    Remarks: Do not try to use the FreeMem function on the pointer
  22.             that the image resides in. Memory is already allocated
  23.             at runtime. Your image resides in the code segment of
  24.             your executable.  Use this method when you have many
  25.             images rather than the method described in Demo5.pas.
  26.  
  27. *)
  28.  
  29.  
  30. Program Demo6;
  31.  Uses Graph;
  32. Var
  33.  Gd   : Integer;
  34.  Gm   : Integer;
  35.  Img  : Pointer;
  36.  
  37. Procedure Disk; External;
  38. {$L DISK.OBJ}
  39.  
  40. Begin
  41.  Gd:=EGA;
  42.  Gm:=EGAhi;
  43.  InitGraph(Gd,Gm,'');
  44.  
  45.  Img:=@Disk;                               (* Pass the Address of the *)
  46.                                            (* Procedure to a pointer. *)
  47.  
  48.  PutImage(300,120,Img^,NormalPut);         (* Display Image *)
  49.  
  50.  ReadLn;                                   (* Wait for Enter Key *)
  51.  
  52.  CloseGraph;                               (* Close graphics *)
  53. End.